<!DOCTYPE html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
<title>商品表</title>
<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			<p>当前活动: {{activity.name}}  ID：{{activity.id}}</p>
			<div class="form-group col-sm-2">
				<input type="text" class="form-control" v-model="q.commodityname" @keyup.enter="query" placeholder="商品名称">
			</div>
			<a class="btn btn-default" @click="query">查询</a>

			<a class="btn btn-primary btn-sm" @click="back">
				<i class="fa fa-back"></i>&nbsp;返回上一页</a>
			<a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;添加商品</a>
			<a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除商品</a>
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>

	<div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
			<div class="form-group">
				<div class="col-sm-2 control-label">活动ID</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" :value="activity.id" placeholder="活动ID" readonly/>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-2 control-label">活动名称</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" :value="activity.name" placeholder="活动名称" readonly/>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-2 control-label">商品列表</div>
				<div class="col-sm-10">
					<select v-model="addPostData.commodityid">
						<option v-bind:value="one.id" v-for="one of allGoodsList">{{one.id + '. '+one.commodityname}}</option>
					</select>
				</div>
			</div>


			<div class="form-group">
				<div class="col-sm-2 control-label">活动价格</div>
				<div class="col-sm-10">
					<input type="number" class="form-control" @change="handleNum" v-model="addPostData.price" placeholder="活动价格"/>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-2 control-label">库存</div>
				<div class="col-sm-10">
					<input type="number" class="form-control" @change="handleNum" v-model="addPostData.totalStore" placeholder="库存"/>
				</div>
			</div>


			<div class="form-group">
				<div class="col-sm-2 control-label"></div>
				<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>

</div>

<script src="${request.contextPath}/statics/js/modules/sys/commodity2.js?_${.now?long}"></script>

</body>
</html>